#!/usr/bin/python3
# coding=utf-8
#
# Copyright (C) 2023-2024. Huawei Technologies Co., Ltd. All rights reserved.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# ===============================================================================

import numpy as np


def gen_golden_data_simple():
    block_num = 48
    m_per_block = 128
    m = block_num * m_per_block
    n = 2048
    matrix_A = np.random.uniform(0, 0.5, (m, n)).astype(np.float16)
    vector_x = np.random.uniform(0, 0.5, n).astype(np.float16)
    golden = matrix_A @ vector_x

    tiling = np.array([block_num, m_per_block, m, n], dtype=np.uint32)
    tiling.tofile("./input/input_tiling.bin")
    matrix_A.tofile("./input/matrix_A.bin")
    vector_x.tofile("./input/vector_X.bin")
    golden.tofile("./output/golden.bin")


if __name__ == "__main__":
    gen_golden_data_simple()
